${page.setTitle("push-center| GOPS")}
<style type="text/css">
    .l-table-edit {}
    .l-table-edit-td{ padding:4px;}
    .l-button-submit,.l-button-reset{width:80px; float:left; margin-left:10px; padding-bottom:2px;}
</style>
${token()}
<div class="body-pla-content">
 <form action="certificate/update.json" method="post" id="certificateForm" name="certificate" enctype="multipart/form-data">
 <input type="hidden" name="id" value="${certificate.id}"/>
        <table class="l-table-edit" >
            <tr>
                <td align="right" >appId：</td>
                <td align="left" >
						<input name="appId" type="text" id="appId"  maxlength="30" value="${certificate.appId}"  validate="{required:true,maxlength:30}"/>
				</td>
            </tr>  
            
            <tr>
                <td align="right" >类型：</td>
                <td align="left" >
						<select name="type" id="type"  style="width: 130px" value="${certificate.type}"  />
               			 <option value="0" <#if certificate.type=='0'>selected</#if> >测试用户</option>
               			 <option value="1" <#if certificate.type=='1'>selected</#if> >线上用户</option>
               			 <option value="2" <#if certificate.type=='2'>selected</#if> >企业用户</option>
					</select>
				</td>
			 </tr> 
			 <tr>
                <td align="right" >证书：</td>
                <td align="left" >
						<input name="file" type="file" id="file"  validate="{required:true}"/>
				</td>
			 </tr> 
			 <tr>
                <td align="right" >密码：</td>
                <td align="left" >
						<input name="password" type="text" id="password"  maxlength="30" value="${certificate.password}"  validate="{required:true,maxlength:30}"/>
				</td>
			 </tr> 
			 <tr>
                <td align="right" >状态：</td>
                <td align="left" >
						<select name="status" id="status"  style="width: 130px" value="${certificate.status}"  />
               			 <option value="0" <#if certificate.status=='0'>selected</#if> >停用</option>
               			 <option value="1" <#if certificate.status=='1'>selected</#if> >启用</option>
					</select>
				</td>
			 </tr> 
             <tr>
				 <td align="right" >备注：</td>
                <td align="left"  colspan=3>
                <textarea rows="3" cols="40" name="memo" id="memo" >${certificate.memo}</textarea>
				</td>
            </tr>  
            <tr>
            	<td></td>
            	<td > <input type="button" value="修改" id="subitButton" class="l-button l-button-submit"/>  </td>
            	<td align="left"></td>
            </tr>
        </table>
    </form>
</div>
<script type="text/javascript">


$(function(){
		$("#subitButton").bind('click',function(){
			
			var appId=$("#appId").val();
			var name=$("#name").val();
			var type=$("#type").val();
			var file=$("#file").val();
			var password=$("#password").val();
			var status=$("#status").val();
			var memo=$("#memo").val();
			if(appId==""){
				alert("appId不可为空");
				return;
			}
			if(type==""){
				alert("类型不可为空");
				return;
			}
			
			if(password==""){
				alert("密码不可为空");
				return;
			}
			if(status==""){
				alert("状态不可为空");
				return;
			}
			$("#certificateForm").submit();
		});
	});
</script>